// 侧边栏导航处理
document.addEventListener('DOMContentLoaded', function() {
    const navItems = document.querySelectorAll('.nav-item');
    
    navItems.forEach(item => {
        item.addEventListener('click', function() {
            const section = this.dataset.section;
            window.location.href = `/${section}`;  // 这里的路由会自动匹配到 main 蓝图中的对应路由
        });
    });

    // 根据当前页面设置活动导航项
    const currentPath = window.location.pathname;
    navItems.forEach(item => {
        if (currentPath.includes(item.dataset.section)) {
            item.classList.add('active');
        }
    });
}); 